<template>
    <div class="order_header">
        <OrderTab />
        <div style="display: flex;align-items: center;">
            <div style="display: flex;margin-right: 16px">
                <div class="bctype" @click="orderStore.changeactivebctype(0)"
                    :class="orderState.activetype == 0 ? 'active_bctype' : ''">软件订单
                </div>
                <div class="bctype" style="margin: 0 4px">/</div>
                <div class="bctype" @click="orderStore.changeactivebctype(1)"
                    :class="orderState.activetype == 1 ? 'active_bctype' : ''">平台订单
                </div>
            </div>
            <div style="margin-right: 16px">
                <el-button v-if="!orderState.excelsta" @click="saveExell" class="exellbutton">导出</el-button>
                <el-button v-if="orderState.excelsta" disabled class="exellbutton2">导出中...</el-button>
            </div>
            <img v-if="!orderState.filterdialog" @click="orderStore.openOrderfilter()" src="@/assets/order/filter.png"
                style="width: 20px;height: 20px;cursor: pointer;" alt="">
            <img v-if="orderState.filterdialog" src="@/assets/order/filter-active.png"
                style="width: 20px;height: 20px;cursor: pointer;" alt="">
        </div>
    </div>
</template>

<script setup>
import OrderTab from "./OrderTab.vue";
const { orderStore, orderState } = inject('OrderStore')

const emits = defineEmits()

const saveExell = () => {
    orderState.excelsta = true
    orderStore.saveExell()
}
</script>

<style lang="scss" scoped>
.order_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    height: 48px;

}

.exellbutton {
    height: 28px;
    padding: 0 16px;
    border-radius: 0;
    background-color: var(--pcmain-color);
    font-size: 14px;
    color: #fff;
}

.exellbutton2,
.exellbutton2:hover {
    height: 28px;
    padding: 0 16px;
    border-radius: 0;
    background-color: var(--pcmain-color);
    font-size: 14px;
    color: #fff;
    opacity: .5;
}

.bctype {
    cursor: pointer;
    font-size: 14px;
    color: #8a8a8a;
}

.active_bctype {
    color: #ff7900;
}
</style>